<?php
$dataPerPage = 100;
if (isset($_GET['pageCount'])) {
	$pageCount = $_GET['pageCount'];
} else {
	$pageCount = 1;
}
$lastpage   = ceil($totalData/$dataPerPage);

$pageCount = (int)$pageCount;
if ($pageCount > $lastpage) {
	$pageCount = $lastpage;
}
if ($pageCount < 1) {
	$pageCount = 1;
}

$limit = 'LIMIT ' .($pageCount - 1) * $dataPerPage .',' .$dataPerPage;
?>